package NGUYENNGOCHUNG;

import java.util.Scanner;

public class DayOnMonth {
	public static void main(String[] args) {
		System.out.println("Tim  so ngay trong thang. ");
		Scanner scan = new Scanner(System.in);
		System.out.println("Nhap vao so thang ban muon xem : ");
		int mo = scan.nextInt();

		scan = new Scanner(System.in);
		System.out.println("Nhap vao so nam ban muon xem : ");
		int ye = scan.nextInt();

		if ((mo == 4) || (mo == 6) || (mo == 9) || (mo == 11)) {
			System.out.println("Thang " + mo + " nam " + ye + " co 30 ngay.");
		} else if ((mo == 1) || (mo == 3) || (mo == 5) || (mo == 7)
				|| (mo == 8) || (mo == 10) || (mo == 12)) {
			System.out.println("Thang " + mo + " nam " + ye + " co 31 ngay.");
		} else if ((mo == 2)
				&& ((ye % 4 == 0 && ye % 100 != 0) || (ye % 400 == 0))) {
			System.out.println("Nam " + ye + " la nam nhuan.");
			System.out.println(" Vay thang " + mo + " nam " + ye
					+ " co 29 ngay.");
		} else {
			System.out.println("Thang " + mo + " nam " + ye + " co 28 ngay.");
		}
	}
}
